package com.gxc.service.impl;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.springframework.stereotype.Service;

/**
 * 测试 @PostConstruct.
 *
 * @author 宫新程
 * @since 2018/12/16 11:05 PM
 */
@Service
public class TestPostConstruct {

  /** 构造方法. */
  public TestPostConstruct() {
    System.out.println("TestPostConstruct的构造方法执行...");
  }

  @PostConstruct
  public void init() {
    System.out.println(this.getClass().getSimpleName() + ".init()方法执行...");
  }

  /** 普通方法. */
  public void test() {
    System.out.println("TestPostConstruct的test方法执行..");
  }

  @PreDestroy
  public void destroy() {
    System.out.println("TestPostConstruct的 destroy() 执行....");
  }
}
